<?php
//Start de sessie
session_start();

// Database connection
include 'includes/connect.php';

// Encodeer het id-nummer uit de URL
if(isset($_GET['id']) && is_numeric($_GET['id']))
{
    $id=$_GET['id'];
    // Retrieve all the data from the table
    $result = mysql_query("SELECT * FROM product WHERE productid='".$id."'")
    or die(mysql_error());
}

###########################################################################################
// Retrieve stdlijstje
$q1 = mysql_query("SELECT stdlijstje FROM klant WHERE klantid='".$_SESSION['klantid']."'")
or die(mysql_error());
$r1 = mysql_fetch_array( $q1 );
$news = $r1['stdlijstje'];
$news = unserialize($news);


unset($news["$id"]);


$news = serialize($news);

$test = "UPDATE klant SET stdlijstje='".$news."' WHERE klantid='".$_SESSION['klantid']."'";
$q2 = mysql_query($test)
or die(mysql_error());

header("Location: view_stdlijst.php");
###########################################################################################

?>